package com.lcxw.hxzbapi.controller.appcontroller;

import com.lcxw.hxzbapi.entity.pojo.FeedBack;
import com.lcxw.hxzbapi.entity.requestBean.AddFeedBackReq;
import com.lcxw.hxzbapi.entity.response.Response;
import com.lcxw.hxzbapi.service.FeedBackService;
import javax.annotation.Resource;
import javax.validation.Valid;
import org.springframework.beans.BeanUtils;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/app/feedBack")
public class FeedBackController {

    @Resource
    FeedBackService feedBackService;

    @PostMapping("/add")
    public Response addFeedBack(@Valid @RequestBody AddFeedBackReq addFeedBackReq) {
        FeedBack feedBack = new FeedBack();
        feedBack.setStatus(0);
        BeanUtils.copyProperties(addFeedBackReq, feedBack);
        feedBackService.save(feedBack);
        return Response.ok();
    }


}
